function SrvAttribute(params){ 
	 
}

SrvAttribute.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new SrvAttribute.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new SrvAttribute.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new SrvAttribute.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	
	
	/** 编号 [非空]       **/
	this.saId=function(saId){if(this.proxy)return this.getProxy().saId(saId);  this.put("saId", saId);return this;};
	/** and sa_id is null */
	this.saIdNull=function(){if(this.proxy)return this.getProxy().saIdNull();if(this.get("saIdNot")==null)this.put("saIdNot", "");this.put("saId", null);return this;};
	/** not .... */
	this.saIdNot=function(){if(this.proxy)return this.getProxy().saIdNot();this.put("saIdNot", "not");return this;};
	this.saIdNotNull=function(){if(this.proxy)return this.getProxy().saIdNotNull();this.put("saIdNot", "not");this.put("saId", null);return this;};
	this.saIdNot=function(saId){if(this.proxy)return this.getProxy().saIdNot(saId);this.put("saIdNot", "not");this.put("saId", saId);return this;};
		
	/** and sa_id <= ? */
	this.saIdMin=function(min){if(this.proxy)return this.getProxy().saIdMin(min);this.put("saIdMin", min);return this;};
	/** and sa_id >= ? */
	this.saIdMax=function(max){if(this.proxy)return this.getProxy().saIdMax(max);this.put("saIdMax", max);return this;};
		
		
	this.saIdIn=function(ids){
		if(this.proxy)return this.getProxy().saIdIn(ids);  this.put("saIdIn", ids);return this;
	};	
		 
	
	
	/** 所属企业 [非空] [SrvHost]      **/
	this.saHost=function(saHost){if(this.proxy)return this.getProxy().saHost(saHost);  this.put("saHost", saHost);return this;};
	/** and sa_host is null */
	this.saHostNull=function(){if(this.proxy)return this.getProxy().saHostNull();if(this.get("saHostNot")==null)this.put("saHostNot", "");this.put("saHost", null);return this;};
	/** not .... */
	this.saHostNot=function(){if(this.proxy)return this.getProxy().saHostNot();this.put("saHostNot", "not");return this;};
	this.saHostNotNull=function(){if(this.proxy)return this.getProxy().saHostNotNull();this.put("saHostNot", "not");this.put("saHost", null);return this;};
	this.saHostNot=function(saHost){if(this.proxy)return this.getProxy().saHostNot(saHost);this.put("saHostNot", "not");this.put("saHost", saHost);return this;};
		
		
	this.saHostIn=function(ids){
		if(this.proxy)return this.getProxy().saHostIn(ids);  this.put("saHostIn", ids);return this;
	};	
		 
	
	
	/** 类型 [非空] [SrvAttribute]      **/
	this.saParent=function(saParent){if(this.proxy)return this.getProxy().saParent(saParent);  this.put("saParent", saParent);return this;};
	/** and sa_parent is null */
	this.saParentNull=function(){if(this.proxy)return this.getProxy().saParentNull();if(this.get("saParentNot")==null)this.put("saParentNot", "");this.put("saParent", null);return this;};
	/** not .... */
	this.saParentNot=function(){if(this.proxy)return this.getProxy().saParentNot();this.put("saParentNot", "not");return this;};
	this.saParentNotNull=function(){if(this.proxy)return this.getProxy().saParentNotNull();this.put("saParentNot", "not");this.put("saParent", null);return this;};
	this.saParentNot=function(saParent){if(this.proxy)return this.getProxy().saParentNot(saParent);this.put("saParentNot", "not");this.put("saParent", saParent);return this;};
		
		
	this.saParentIn=function(ids){
		if(this.proxy)return this.getProxy().saParentIn(ids);  this.put("saParentIn", ids);return this;
	};	
		 
	
	
	/** 名称 [非空]    属性名称，如html中select的option的text内容   **/
	this.saName=function(saName){if(this.proxy)return this.getProxy().saName(saName);  this.put("saName", saName);return this;};
	/** and sa_name is null */
	this.saNameNull=function(){if(this.proxy)return this.getProxy().saNameNull();if(this.get("saNameNot")==null)this.put("saNameNot", "");this.put("saName", null);return this;};
	/** not .... */
	this.saNameNot=function(){if(this.proxy)return this.getProxy().saNameNot();this.put("saNameNot", "not");return this;};
	this.saNameNotNull=function(){if(this.proxy)return this.getProxy().saNameNotNull();this.put("saNameNot", "not");this.put("saName", null);return this;};
	this.saNameNot=function(saName){if(this.proxy)return this.getProxy().saNameNot(saName);this.put("saNameNot", "not");this.put("saName", saName);return this;};
		
		 
	
	
	/** 标识     程序变量命名规则格式   **/
	this.saFlag=function(saFlag){if(this.proxy)return this.getProxy().saFlag(saFlag);  this.put("saFlag", saFlag);return this;};
	/** and sa_flag is null */
	this.saFlagNull=function(){if(this.proxy)return this.getProxy().saFlagNull();if(this.get("saFlagNot")==null)this.put("saFlagNot", "");this.put("saFlag", null);return this;};
	/** not .... */
	this.saFlagNot=function(){if(this.proxy)return this.getProxy().saFlagNot();this.put("saFlagNot", "not");return this;};
	this.saFlagNotNull=function(){if(this.proxy)return this.getProxy().saFlagNotNull();this.put("saFlagNot", "not");this.put("saFlag", null);return this;};
	this.saFlagNot=function(saFlag){if(this.proxy)return this.getProxy().saFlagNot(saFlag);this.put("saFlagNot", "not");this.put("saFlag", saFlag);return this;};
		
		 
	
	
	/** 数据        **/
	this.saData=function(saData){if(this.proxy)return this.getProxy().saData(saData);  this.put("saData", saData);return this;};
	/** and sa_data is null */
	this.saDataNull=function(){if(this.proxy)return this.getProxy().saDataNull();if(this.get("saDataNot")==null)this.put("saDataNot", "");this.put("saData", null);return this;};
	/** not .... */
	this.saDataNot=function(){if(this.proxy)return this.getProxy().saDataNot();this.put("saDataNot", "not");return this;};
	this.saDataNotNull=function(){if(this.proxy)return this.getProxy().saDataNotNull();this.put("saDataNot", "not");this.put("saData", null);return this;};
	this.saDataNot=function(saData){if(this.proxy)return this.getProxy().saDataNot(saData);this.put("saDataNot", "not");this.put("saData", saData);return this;};
		
		 
	
	
	/** 状态 [非空]   1:有效 0:内容     **/
	this.saStatus=function(saStatus){if(this.proxy)return this.getProxy().saStatus(saStatus);  this.put("saStatus", saStatus);return this;};
	/** and sa_status is null */
	this.saStatusNull=function(){if(this.proxy)return this.getProxy().saStatusNull();if(this.get("saStatusNot")==null)this.put("saStatusNot", "");this.put("saStatus", null);return this;};
	/** not .... */
	this.saStatusNot=function(){if(this.proxy)return this.getProxy().saStatusNot();this.put("saStatusNot", "not");return this;};
	this.saStatusNotNull=function(){if(this.proxy)return this.getProxy().saStatusNotNull();this.put("saStatusNot", "not");this.put("saStatus", null);return this;};
	this.saStatusNot=function(saStatus){if(this.proxy)return this.getProxy().saStatusNot(saStatus);this.put("saStatusNot", "not");this.put("saStatus", saStatus);return this;};
		
		
	this.saStatusIn=function(ids){
		if(this.proxy)return this.getProxy().saStatusIn(ids);  this.put("saStatusIn", ids);return this;
	};	
		 
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有通用属性 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/configurator/attribute.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取通用属性分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/configurator/attribute.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取通用属性 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/configurator/attribute.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

SrvAttribute.get = function(id){
	var protocol = ux.ajax("/admin/configurator/attribute.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.srvAttribute;
	return null;
}

SrvAttribute.where = new SrvAttribute.Where(0,true);